
import java.io.IOException;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
import java.sql.SQLException;

/**
 *
 * @author Administrator
 */
public class stData2File {
        void Data2File() throws IOException, SQLException {
        //FirstFrame newFrame=new FirstFrame();
        
        String sYear = stJudge.sYear;
        String sMonth =stJudge.sMonth;
        String sDay = stJudge.sDay;
        String sBH = stJudge.sBH;
        String sBM = stJudge.sBM;
        String sEH = stJudge.sEH;
        String sEM = stJudge.sEM;
        String sText = FirstFrame.stText.getText();
        
        stComputeTime compute=new stComputeTime();
        int sSum=compute.computeTime();
        
        String sDate=sYear+sMonth+sDay;

        /*String date = sYear + "\t" + sMonth + "\t" + sDay + "\t" + sBH + "\t" + sBM + "\t" + sEH + "\t" + sEM + "\t" + sText + "\n";
        //创建文件，如果已经存在则在文件末尾插入
        FileWriter writer = new FileWriter("date.txt",true);
        writer.write(date);
        writer.close();*/
        String insert;
        insert="INSERT INTO STBase VALUES( '"+sYear+"','"+sMonth+"','"+sDay+"','"+sBH+"','"+sBM+"','"+sEH+"','"+sEM+"','"+sText+"','"+sSum+"','"+sDate+"')";
        stDB.DBConnect();
        stDB.DBSqlAdd(insert);
        stDB.DBClosed();
    }
}
